#ifndef SimpleGraph_H
#define SimpleGraph_H

#include "AdjacencyList.h"
#include "DistanceMatrix.h"
#include "Edge.h"

#include <vector>

namespace zbp
{
	class SimpleGraph
	{
	public:		
		AdjacencyList adjacency_list;
	
		SimpleGraph() {}
		~SimpleGraph() {}

		int get_nodes_count();

		void add_edge(Edge e);
		void add_edge(int n1_index, int n2_index, int weight);

		void display();
		
		bool dijkstra(int s, vector<int> &d, vector<int> &p);

		void breadth_first_search(int s, vector<bool> &d);

		bool floyd_warshall_initialized(DistanceMatrix<int> &d);
		bool floyd_warshall(DistanceMatrix<int> &d);

		bool bellman_ford_initialized(int s, vector<int> &d, vector<int> &p);
		bool bellman_ford(int s, vector<int> &d, vector<int> &p);

		bool johnson_initialized(DistanceMatrix<int> &d);
		bool johnson(DistanceMatrix<int> &d);
		
		bool has_negative_cycle();
		bool has_negative_cycle(vector<int> &d);

		void initialize_distance_matrix(DistanceMatrix<int> &d);
		void initialize_adjacency_list(vector<int> &d, vector<int> &p);
	
	private:
		static const int inf = INT_MAX;

		void relaxation(vector<int> &d, vector<int> &p, int u, int v, double weight);
	};
}

#endif